package PTA.javaA;

import java.util.Scanner;

public class ex13 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n= sc.nextInt();
        Perso s[] = new Perso[n];
        for(int i=0;i<n;i++){
            String name = sc.nextLine();
            boolean gender = sc.nextBoolean();
            int age = sc.nextInt();
            s[i]= new  Perso(name,gender,age);
        }
        for(int i=n-1;i>=0;i--){
            System.out.println(s[i].toString());
        }
        Person p1=new Person();
        System.out.println(p1.toString());
    }
}
class Perso{
    static {
        System.out.println("This is static initialization block");
    }
    private String name;

    private boolean gender;
    private int age;
    private int id;
    private int num=0;
    public Perso() {
        System.out.println("This is initialization block, id is " + num);
        System.out.println("This is constructor");
        id = num;
        num++;
        System.out.println(name + "," + age + "," + gender + "," + id);
        System.out.println(toString());
    }
    public Perso(String name,boolean gender,int age){
        this.age=age;
        this.name=name;
        this.gender=gender;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean isGender() {
        return gender;
    }

    public void setGender(boolean gender) {
        this.gender = gender;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Override
    public String toString() {
        return "Perso[" +
                "name='" + name + '\'' +
                ", gender=" + gender +
                ", age=" + age +
                ", id=" + id +
                ']';
    }
}
